<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>



<script>
    let name="广告", age=100;

    let school={name,age};
    let str="name"

    let obj={
        fn(){},
        //fn：function(){}
        //属性名是字符串,属性名使用[]  里面可以写变量
        [str]:name,
        ["my"+str]:name
    }

</script>
</body>
</html>